package com.example.service;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.stereotype.Service;

@Service
public class H implements InitializingBean {
    String str = "132";

    //    @Autowired
//    @Resource
    A a2;

//    public void setA2(A a2) {
//        this.a2 = a2;
//    }

    public H(A a1) {
        this.a2 = a1;
    }

    public A getA() {
        System.out.println("~~~~~~" + this.str);
        return this.a2;
    }

    @Override
    public void afterPropertiesSet() throws Exception {
        System.out.println("afterPropertiesSet");
        this.str = "HHH";
    }

}
